#include "../src/base/ThreadPool.h"
#include <iostream>
#include <atomic>
using namespace std;

void task()
{
    cout << "Hello World!" << endl;
}

int main()
{
    //TODO 存在段错误，非法参数异常
    ThreadPool pool;
    pool.append(std::function<void()>(task));
    pool.append(std::function<void()>(task));
    pool.append(std::function<void()>(task));
    pool.append(std::function<void()>(task));
    pool.append(std::function<void()>(task));
    pool.append(std::function<void()>(task));
    pool.append(ThreadPool::Task(task));
    // int i = 0;
    // while (true)
    // {
    //     i++;
    //     pool.append(std::function<void()>(task));
    //     if(i >= 1000) {
    //         pool.stop();
    //         break;
    //     }
    // }
    while(1);
}